<template>
	<view class="page" style="padding-top: 104rpx;">
		<view class="header">
			<image @click="back" class="back" src="../../static/tian/back.png" mode=""></image>
			<view class="text">{{$t('first.title35')}}</view>
			<view></view>
		</view>
		<view class="con">
			<image class="invitabg" src="../../static/tian/invitabg.png" mode=""></image>
			<view class="invita_title">{{$t('first.title24')}}</view>
			<view class="invita_down">
				<view class="img">
					<image class="bg" src="../../static/tian/invitaimg.png" mode=""></image>
					<view class="erweimabox">
						<image class="erweima" :src="erweima" mode=""></image>
					</view>
					<view class="link_btn">
						<view class="link_title">{{$t('first.title48')}}</view>
						<div class="link_address">{{urls}}</div>
					</view>
					<view class="btn" @click="copy(urls)">{{$t('first.title49')}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {domain} from '../../config/domain.js'
	export default{
		data(){
			return{
				list:[],
				urls:'',
				erweima:''
			}
		},
		onLoad() {
			// this.getinfo()
			this.geterweima()
		},
		methods:{
			getinfo(){
				var url=domain + 'api/user/info';
				var mytype='get';
				var userinfo = uni.getStorageSync('userinfo');
				uni.request({
					url,
					method: mytype,
					header: {
						'content-type': 'application/x-www-form-urlencoded' ,//自定义请求头信息
						'Lang':uni.getStorageSync('lang'),
						'AUTHORIZATION':userinfo.token,
					},
					success: res => {
						if(res.data.code == 1){
							this.list = res.data.data
						}
					},
					fail: (err) => {
						console.log(err)
					},
					complete: () => {
						setTimeout(function() {
							uni.hideLoading();
						}, 1000);
					}
				});
			},
			geterweima(){
				var url=domain + 'api/user/partnerInfo';
				var mytype='get';
				var userinfo = uni.getStorageSync('userinfo');
				uni.request({
					url,
					method: mytype,
					header: {
						'content-type': 'application/x-www-form-urlencoded' ,//自定义请求头信息
						'Lang':uni.getStorageSync('lang'),
						'AUTHORIZATION':userinfo.token,
					},
					success: res => {
						if(res.data.code == 1){
							this.urls = res.data.data.domain;
							this.erweima = res.data.data.poster_path;
						}
					},
					fail: (err) => {
						console.log(err)
					},
					complete: () => {
						setTimeout(function() {
							uni.hideLoading();
						}, 1000);
					}
				});
			},
			copy(value){
				uni.setClipboardData({
					data:value,//要被复制的内容
					success:()=>{//复制成功的回调函数
						uni.showToast({//提示
							title:this.$t('first.title115')
						})
					}
				});
			},
			back(){
				uni.navigateBack()
			}
		}
	}
</script>

<style scoped>
	*{
		margin: 0;
		padding: 0;
		box-sizing: border-box;
	}
	.page{
		width: 100%;
		height: 100%;
		min-height: 100vh;
		background-color: #ecf0f5;
	}
	.header{
		width: 100%;
		height: 104rpx;
		padding: 20rpx;
		position: fixed;
		background-color: #ecf0f5;
		display: flex;
		top: 0;
		left: 0;
		align-items: center;
		justify-content: space-between;
		z-index: 999;
	}
	.back{
		width: 48rpx;
		height: 48rpx;
	}
	.header .text{
		font-size: 36rpx;
		font-family: PingFangSC-Medium,PingFang SC;
		font-weight: 600;
		color: #222;
	}
	.con{
		width: 100%;
		height: 100%;
		position: fixed;
		top: 0;
		bottom: 0;
		background-color: #14162a;
		overflow-y: scroll;
	}
	.invitabg{
		width: 100%;
		height: 100%;
	}
	.invita_title{
		padding: 0 100rpx;
		box-sizing: border-box;
		font-size: 24rpx;
		font-family: PingFangSC-Semibold,PingFang SC;
		font-weight: 600;
		line-height: 36rpx;
		color: #fff;
		text-align: center;
		position: absolute;
		top: 28%;
	}
	.invita_down{
		position: absolute;
		bottom: 72rpx;
		left: 0;
		right: 0;
		padding: 0 52rpx;
		box-sizing: border-box;
	}
	.img{
		width: 100%;
		height: 708rpx;
		position: relative;
	}
	.img .bg{
		width: 100%;
		height: 100%;
	}
	.erweimabox{
		width: 256rpx;
		height: 256rpx;
		background: #fff;
		border-radius: 14rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		position: absolute;
		top: 60rpx;
		left: 196rpx;
	}
	.erweima{
		width: 224rpx;
		height: 224rpx;
	}
	.link_btn{
		width: 532rpx;
		min-height: 132rpx;
		background: #4076a9;
		border-radius: 30rpx;
		border: 2rpx solid #feb;
		position: absolute;
		left: 56rpx;
		top: 386rpx;
		font-size: 24rpx;
		font-family: PingFangSC-Semibold,PingFang SC;
		font-weight: 600;
		color: #fff;
		padding: 20rpx;
		box-sizing: border-box;
	}
	.link_title{
		font-size: 24rpx;
		font-family: PingFangSC-Semibold,PingFang SC;
		font-weight: 600;
		color: #fff;
	}
	.link_address{
		font-size: 24rpx;
		font-family: PingFangSC-Semibold,PingFang SC;
		font-weight: 600;
		color: #fff;
		word-wrap:break-word;
	}
	.btn{
		width: 532rpx;
		height: 84rpx;
		background: linear-gradient(90deg,#fff0cc,#ffe676 98%);
		box-shadow: 0 0.08rem 0.18667rem 0 rgb(0 12 93 / 50%);
		border-radius: 70rpx;
		font-size: 36rpx;
		font-family: PingFangSC-Semibold,PingFang SC;
		font-weight: 600;
		color: #8f6a00;
		text-align: center;
		line-height: 84rpx;
		position: absolute;
		bottom: 42rpx;
		left: 56rpx;
	}
</style>